home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / pbaseiv.zip / P4SPR001.TIP < prev    next >
Text File  |  1991-12-16  |  3KB  |  65 lines

  1. Lotus's 1-2-3 recognizes dates in the next century, but only
  2. if you type three-digit year values like 101 for the year
  3. 2001 or 110 for 2010, or use the full four-digit years. When
  4. you're entering a lot of dates, one- or two-digit years like
  5. 2 or 12 are much easier to type, but these translate to 1902
  6. and 1912--not years for which you're likely to do much
  7. financial planning.
  8.  
  9. For worksheets that forecast into the next century, I wrote
  10. a macro that lets me enter twenty-first--century dates as
  11. two-digit years. The macro works by adding @date(99,12,31)
  12. to @date(year,month,day)--where `year' is the label of a
  13. cell that holds a value from 0 to 89--effectively adding a
  14. century to the year typed. Because such dates display in
  15. Long Int'l format (MM/DD/YYYY), I increase the column width
  16. to at least 11 for the macro's target cells.
  17.  
  18. David H. Noble
  19. Roanoke, Virginia
  20.  
  21. Editor's note: This macro [included in the file
  22. P4SPREAD\CENTURY.WK1 on your PowerBase *.* Volume IV
  23. diskette] works equally well in 1-2-3 and Quattro Pro.
  24.  
  25. If you want to create it from scratch, type the macro in the
  26. listing below into six out-of-the-way cells, pressing '
  27. before the last line. Use /Range Name Create to name the
  28. first cell \d and to name three other out-of-the-way cells
  29. Month, Day, and Year.
  30.  
  31. To run the macro, press <Alt>-D, then answer the prompts for
  32. the month, day, and year values. The current column must be
  33. at least 11 characters wide. To see how the macro converts
  34. years, run it several times with such year values as 2, 45,
  35. and 91.
  36.  
  37. I modified Mr. Noble's original macro to recognize values
  38. from 90 to 99 as the years 1990 to 1999. Values from 0 to 89
  39. correspond to the years 2000 to 2089. To change this, adjust
  40. the expressions at rows 4 and 5. For example, if you want 50
  41. to 99 to represent the years 1950 to 1999 and 0 to 49 to
  42. mean the years 2000 to 2049, change `90' to 50 and `89' to
  43. 49.
  44.  
  45.  
  46. This macro lets you enter dates in the 21st century easily.
  47.  
  48.         A        B        C         D         E        F
  49. 1   \d       {getnumber "Enter Month: ",month}
  50. 2            {getnumber "Enter Day: ",day}
  51. 3            {getnumber "Enter Year: ",year}
  52. 4            {if year<90}@date(year,month,day)+@date(99,12,31)~
  53. 5            {if year>89}@date(year,month,day)~
  54. 6            /rfd4~/rv~~
  55. 7
  56. 8   Year            1          11/25/2001
  57. 9   Month          11
  58. 10  Day            25
  59.  
  60. Title: 2001: A Worksheet Oddity
  61. Category: SPR
  62. Issue date: Jan 1991
  63. Editor: Tom Swan
  64. Supplementary files: P4SPREAD\CENTURY.WK1
  65.